package com.sgb.jicai.entity;

import android.text.TextUtils;

import com.swgk.core.util.TimeUtil;

import java.io.Serializable;
import java.util.List;

/**
 * 复用
 * 需方发起  参与报价页面   加盟单位列表实体类
 * 需方发起  加盟集采页面   报价单位列表实体类
 */
public class JiCaiJoinInQuotedPriceCompanyEntity implements Serializable {

    private String createCompany;//企业名称
    private String placeOfDelivery;//收货地
    private String contacts;//联系人
    private String contactNumber;//联系方式
    private String director;//负责人
    private String directorNumber;//负责人联系方式
    private String email;//邮箱
    private String joinCount;//需求数量
    private String unitName;//商品单位
    private String createTime;//创建时间
    private String remarks;//备注
    private List<RecordsDataEntity> records;

    public String getCreateCompany() {
        return createCompany;
    }

    public void setCreateCompany(String createCompany) {
        this.createCompany = createCompany;
    }

    public String getPlaceOfDelivery() {
        return placeOfDelivery;
    }

    public void setPlaceOfDelivery(String placeOfDelivery) {
        this.placeOfDelivery = placeOfDelivery;
    }

    public String getContacts() {
        return contacts;
    }

    public void setContacts(String contacts) {
        this.contacts = contacts;
    }

    public String getContactNumber() {
        return contactNumber;
    }

    public void setContactNumber(String contactNumber) {
        this.contactNumber = contactNumber;
    }

    public String getDirector() {
        return director;
    }

    public void setDirector(String director) {
        this.director = director;
    }

    public String getDirectorNumber() {
        return directorNumber;
    }

    public void setDirectorNumber(String directorNumber) {
        this.directorNumber = directorNumber;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public String getJoinCount() {
        return joinCount;
    }

    public void setJoinCount(String joinCount) {
        this.joinCount = joinCount;
    }

    public String getUnitName() {
        return unitName;
    }

    public void setUnitName(String unitName) {
        this.unitName = unitName;
    }

    public String getCreateTime() {
        if (!TextUtils.isEmpty(createTime)) {
            return TimeUtil.getDateTimeString(Long.valueOf(createTime), "yyyy-MM-dd HH:mm");
        } else {
            return "";
        }
    }

    public void setCreateTime(String createTime) {
        this.createTime = createTime;
    }

    public String getRemarks() {
        return remarks;
    }

    public void setRemarks(String remarks) {
        this.remarks = remarks;
    }

    public List<RecordsDataEntity> getRecords() {
        return records;
    }

    public void setRecords(List<RecordsDataEntity> records) {
        this.records = records;
    }

    public class RecordsDataEntity implements Serializable {
        private String groupbuyingNo;//集采业务编号
        private String groupbuyingDetailNo;//清单编号
        private String participant;//参与人
        private String pickTime;//提货时间
        private String entranceTime;//入场时间
        private String exitTime;//结束时间
        @Deprecated //V 1。17 去掉这个字段
        private String expectPrice;// 预期价格
        private int groupbuyClass;
        private String num;//采购量
        private String unitName;//单位
        private String rangeBrands;//品牌
        private List<AttrlistEntity> attrlist;
        //商品参数---使用attrlist拼接
        private String goodsParameters;//商品参数
        private String goodsMaterial;
        private String goodsQuality;
        private String goodsMaintenance;
        private String goodsPurpose;

        public String getGoodsMaterial() {
            if (!TextUtils.isEmpty(goodsMaterial)){
                return goodsMaterial;
            }else {
                return "/";
            }
        }

        public void setGoodsMaterial(String goodsMaterial) {
            this.goodsMaterial = goodsMaterial;
        }

        public String getGoodsQuality() {
            if (!TextUtils.isEmpty(goodsQuality)){
                return goodsQuality;
            }else {
                return "/";
            }
        }

        public void setGoodsQuality(String goodsQuality) {
            this.goodsQuality = goodsQuality;
        }

        public String getGoodsMaintenance() {
            if (!TextUtils.isEmpty(goodsMaintenance)){
                return goodsMaintenance;
            }else {
                return "/";
            }
        }

        public void setGoodsMaintenance(String goodsMaintenance) {
            this.goodsMaintenance = goodsMaintenance;
        }

        public String getGoodsPurpose() {
            if (!TextUtils.isEmpty(goodsPurpose)){
                return goodsPurpose;
            }else {
                return "/";
            }
        }

        public void setGoodsPurpose(String goodsPurpose) {
            this.goodsPurpose = goodsPurpose;
        }

        public String getEntranceTime() {
            if (null != entranceTime && entranceTime.length() > 0 && !entranceTime.equals("0")) {
                return TimeUtil.getDateStringYMD(Long.valueOf(entranceTime));
            } else {
                return "";
            }
        }

        public void setEntranceTime(String entranceTime) {
            this.entranceTime = entranceTime;
        }

        public String getExitTime() {
            if (null != exitTime && exitTime.length() > 0 && !exitTime.equals("0")) {
                return TimeUtil.getDateStringYMD(Long.valueOf(exitTime));
            } else {
                return "";
            }
        }

        public void setExitTime(String exitTime) {
            this.exitTime = exitTime;
        }

        public int getGroupbuyClass() {
            return groupbuyClass;
        }

        public void setGroupbuyClass(int groupbuyClass) {
            this.groupbuyClass = groupbuyClass;
        }

        public String getGroupbuyingNo() {
            return groupbuyingNo;
        }

        public void setGroupbuyingNo(String groupbuyingNo) {
            this.groupbuyingNo = groupbuyingNo;
        }

        public String getGroupbuyingDetailNo() {
            return groupbuyingDetailNo;
        }

        public void setGroupbuyingDetailNo(String groupbuyingDetailNo) {
            this.groupbuyingDetailNo = groupbuyingDetailNo;
        }

        public String getParticipant() {
            return participant;
        }

        public void setParticipant(String participant) {
            this.participant = participant;
        }

        public String getPickTime() {
            if (null != pickTime && pickTime.length() > 0 && !pickTime.equals("0")) {
                return TimeUtil.getDateStringYMD(Long.valueOf(pickTime));
            } else {
                return "";
            }
//            return pickTime;
        }

        public void setPickTime(String pickTime) {
            this.pickTime = pickTime;
        }

        @Deprecated
        public String getExpectPrice() {
            return expectPrice;
        }

        @Deprecated
        public void setExpectPrice(String expectPrice) {
            this.expectPrice = expectPrice;
        }

        public String getNum() {
            return num;
        }

        public void setNum(String num) {
            this.num = num;
        }

        public String getUnitName() {
            return unitName;
        }

        public void setUnitName(String unitName) {
            this.unitName = unitName;
        }

        public String getRangeBrands() {
            return rangeBrands;
        }

        public void setRangeBrands(String rangeBrands) {
            this.rangeBrands = rangeBrands;
        }

        public List<AttrlistEntity> getAttrlist() {
            return attrlist;
        }

        public void setAttrlist(List<AttrlistEntity> attrlist) {
            this.attrlist = attrlist;
        }

        public String getGoodsParameters() {
            List<AttrlistEntity> parameters = getAttrlist();
            if (null != parameters && !parameters.isEmpty()) {
                StringBuffer str = new StringBuffer();
                for (int index = 0; index < parameters.size(); index++) {
                    if (!TextUtils.isEmpty(parameters.get(index).getValue())){
                        str.append(parameters.get(index).getName()).append(":").append(parameters.get(index).getValue()).append("   ");
                    }
                }
                if (!TextUtils.isEmpty(str.toString())){
                    return new String(str);
                }else {
                    return "无";
                }
            } else {
                return "无";
            }
        }

        public void setGoodsParameters(String goodsParameters) {
            this.goodsParameters = goodsParameters;
        }
    }

    public class AttrlistEntity implements Serializable {
        private String name;
        private String value;
        //其它未使用字段暂未定义

        public String getName() {
            return name;
        }

        public void setName(String name) {
            this.name = name;
        }

        public String getValue() {
            return value;
        }

        public void setValue(String value) {
            this.value = value;
        }
    }
}

